package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the OFIC_REGISTRAL database table.
 * 
 */
@Embeddable
public class OficRegistralPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String regPubId;
	private String oficRegId;

    public OficRegistralPK() {
    }

	@Column(name="REG_PUB_ID", unique=true, nullable=false, length=2)
	public String getRegPubId() {
		return this.regPubId;
	}
	public void setRegPubId(String regPubId) {
		this.regPubId = regPubId;
	}

	@Column(name="OFIC_REG_ID", unique=true, nullable=false, length=2)
	public String getOficRegId() {
		return this.oficRegId;
	}
	public void setOficRegId(String oficRegId) {
		this.oficRegId = oficRegId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof OficRegistralPK)) {
			return false;
		}
		OficRegistralPK castOther = (OficRegistralPK)other;
		return 
			this.regPubId.equals(castOther.regPubId)
			&& this.oficRegId.equals(castOther.oficRegId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.regPubId.hashCode();
		hash = hash * prime + this.oficRegId.hashCode();
		
		return hash;
    }
}